package com.letu.mq;

import com.letu.mq.config.ChangeSelectorExpressionBeforeMqStartOfBusiness;
import com.letu.mq.listener.BusinessPointListner;
import com.letu.mq.listener.DieBusinessPointListner;
import com.letu.mq.service.CheckTopicTagServer;
import com.letu.mq.service.impl.CheckTopicTagServerImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.DependsOn;
import org.springframework.stereotype.Component;

/**
 * base配置，里面包含mvc 拦截器,这样包含springUtils实体
 *
 * @author ligang
 * @date 2017-12-15 14:42
 */
@RequiredArgsConstructor
public class RocketConfiguration {

//    /**
//     * 赛选 tag 内存实现类
//     *
//     * @return
//     */
//    @Bean
//    @ConditionalOnMissingBean(CheckTopicTagServer.class)
//    public CheckTopicTagServer getCheckTopicTagServer() {
//        return new CheckTopicTagServerImpl();
//    }
//
//    /**
//     * 赛选 tag实现类
//     * 不太清楚原因：
//     * jdk 8高版本去掉不报错  @ConditionalOnBean({BusinessPointListner.class})
//     * 低版本去掉报错  @ConditionalOnBean({BusinessPointListner.class})
//     * 目前linux是低版本
//     * <p>
//     * 高版本去掉，低版本不能去掉
//     *
//     * @return
//     */
//    @Bean
//    @ConditionalOnMissingBean(ChangeSelectorExpressionBeforeMqStartOfBusiness.class)
////    @ConditionalOnBean(name = "businessPointListner")
//    @DependsOn({"businessPointListner"})
//    public ChangeSelectorExpressionBeforeMqStartOfBusiness getChangeSelectorExpressionBeforeMqStartOfBusiness() {
//        return new ChangeSelectorExpressionBeforeMqStartOfBusiness();
//    }
//
//
//    /**
//     * ChangeSelectorExpressionBeforeMqStartOfBusiness
//     * lamp.log.enabled = true 并且 lamp.log.type=DB时实例该类
//     *
//     * @return 监听业务mq
//     */
//    @Bean("businessPointListner")
//    @ConditionalOnMissingBean(BusinessPointListner.class)
//    public BusinessPointListner getBusinessPointListner() {
//        return new BusinessPointListner();
//    }
//
//    /**
//     * @return 监听死信
//     */
//    @Bean
//    @ConditionalOnMissingBean(DieBusinessPointListner.class)
//    public DieBusinessPointListner getDieBusinessPointListner() {
//        return new DieBusinessPointListner();
//    }


//
//    /**
//     * lamp.log.enabled = true 并且 lamp.log.type=DB时实例该类
//     *
//     * @return 监听
//     */
//    @Bean
//    @ConditionalOnMissingBean(DieBusinessPointListner.class)
//    @ConditionalOnBean({ChangeSelectorExpressionBeforeMqStartOfBusiness.class})
//    public DieBusinessPointListner getDieBusinessPointListner() {
//        return new DieBusinessPointListner();
//    }


}
